var gulp = require('gulp');
var less = require('gulp-less');
var  cssmin = require('gulp-minify-css');//压缩css

/*
 *编译less
 */
gulp.task('less', function () {
    gulp.src(['assets/less/**'])
        .pipe(less())
        .pipe(gulp.dest('assets/css'));
});

/*
 *压缩css
 */
gulp.task('compress', function () {
    gulp.src(['assets/css/**'])
        .pipe(cssmin())
        .pipe(gulp.dest('assets/css/all'));
});

/*
 *监听
 */
gulp.task('watch',['less'], function () {
    gulp.watch('assets/less/**', ['less']);
});
